Skip to content

Conversation

@rekby
Copy link
Member

@rekby rekby commented May 25, 2023

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Raise unimplemented exception for stop partition request

What is the new behavior?

Hanlde stop partition request

Close #297

@rekby rekby requested a review from Valeria1235 May 25, 2023 09:15
@rekby rekby self-assigned this May 25, 2023


class UnexpectedGrpcMessage(Error):
def __init__(self, message: str):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useless __init__

_buffer_size_bytes: int # use for init request, then for debug purposes only
_decode_executor: concurrent.futures.Executor
_decoders: Dict[int, typing.Callable[[bytes], bytes]] # dict[codec_code] func(encoded_bytes)->decoded_bytes
_logger: logging.Logger
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this internal logger for? I think this is strange and complicating.

def set_logged(*args, **kwargs):
logged.set()

stream_reader._logger = mock.Mock()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are more beautiful and simple way to check log in pytest.
looks at https://docs.pytest.org/en/7.1.x/how-to/logging.html#caplog-fixture

@rekby rekby merged commit cd93e4a into main May 25, 2023
@rekby rekby deleted the 297-stop-partition branch May 25, 2023 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Implement handler for stop partition

3 participants